<template>
  <div>
    <iframe src="http://127.0.0.1:8006/swagger-ui.html" id="map" frameborder="0"
            width="100%"
            style="border: 0px;margin: 0"></iframe>
  </div>
</template>


<script>
export default {
  data() {
    return {}
  },
  mounted() {
    /**
     * iframe-宽高自适应显示
     */
    function changeMapIframe() {
      const map = document.getElementById('map')
      const deviceWidth = document.body.clientWidth
      const deviceHeight = document.body.clientHeight
      map.style.width = (Number(deviceWidth) ) + 'px' //数字是页面布局宽度差值
      map.style.height = (Number(deviceHeight) ) + 'px' //数字是页面布局高度差
    }

    changeMapIframe()

    window.onresize = function() {
      changeMapIframe()
    }
  }
}
</script>
